# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=keysmith
pkgver=24.08.2
pkgrel=0
pkgdesc="OTP client for Plasma Mobile and Desktop"
url="https://invent.kde.org/kde/keysmith"
arch="all !armhf"
license="GPL-3.0-or-later"
depends="
	kirigami
	kirigami-addons
	"
makedepends="
	extra-cmake-modules
	kdbusaddons-dev
	ki18n-dev
	kirigami-dev
	libsodium-dev
	qqc2-desktop-style-dev
	qt6-qt5compat-dev
	qt6-qtbase-dev
	qt6-qtsvg-dev
	samurai
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/utilities/keysmith.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/keysmith-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure -E "account-storage-(object-lifecycles|default-lifecycle|hotp-counter-update)"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
5a39d50189863eeb527a7dd36e904ecde31b1b2c0eaa2684ce1c95cd0a215030a6a37227023e0478ba6e5309d18f4480755118bb32aa089341464b354b23b507  keysmith-24.08.2.tar.xz
"
